import { createProdMockServer } from "vite-plugin-mock/client";

const modules = import.meta.glob("./modules/**/*.ts", { eager: true }) as any;

const mockModules: any[] = [];
Object.keys(modules).forEach((key) => {
    if (key.includes("/_")) {
        return;
    }
    mockModules.push(...modules[key].default);
});
/**
 * Used in a production environment. Need to manually import all modules
 */
export function setupProdMockServer() {
    createProdMockServer(mockModules);
}
